Skip to content

fix: repair Docker dev-environment build and clarify native setup#388

Merged
emil916 merged 2 commits into
masterfrom
fix/docker-dev-setup
Jun 22, 2026
Merged

fix: repair Docker dev-environment build and clarify native setup#388
emil916 merged 2 commits into
masterfrom
fix/docker-dev-setup

Conversation

@bushidocodes

Copy link
Copy Markdown
Contributor

Summary

The documented setup instructions were failing. The native path assumes a Debian host with LLVM 13, but aWsm's llvm-alt bindings call LLVM C-API functions (LLVMBuildCall, LLVMBuildLoad) that were removed in LLVM 15+ — so on a newer host (e.g. Ubuntu 24.04 / LLVM 21) the build fails to link (undefined symbol: LLVMBuildCall), and install_deb.sh can't even run (libtinfo5 and LLVM 13 aren't available there).

The Docker route exists precisely to pin the LLVM-13 toolchain, but it had bit-rotted in several places. This PR repairs the Docker build and documents the native constraint. (A separate change to the gocr zlib download URL is needed too, but it lives in a nested submodule and will be handled via the submodule chain.)

Changes

Dockerfile.x86_64

  • Install hey from focal's universe repo instead of downloading the prebuilt binary — the hey-release S3/GCS URLs now return 403.
  • git config --system --add safe.directory '*' so the root-run make install doesn't abort with "dubious ownership" on the host-owned, bind-mounted /sledge.
  • Set RUSTUP_HOME/CARGO_HOME to the dev user's install so the root-run build can resolve the default Rust toolchain instead of failing with "no default is configured".

Makefile

  • Make the wasm_apps symlink rule idempotent (ln -srfn). The symlink is committed to the repo, so it already exists on a fresh clone and the old ln -sr failed with "File exists", breaking make install.

README.md

  • Recommend the Docker route and add an explicit caveat to the native section documenting the LLVM-13/Debian requirement and why Ubuntu 24.04 (and other non-LLVM-13 hosts) can't use it.

Verification

./devenv.sh setup now completes end-to-end: aWsm, the runtime, and all benchmark apps build. The runtime was launched against the built binaries and served:

  • fibonacciGET /fib?1055, ?206765 (correct HTTP headers)
  • gocr — OCR output exact-matched the test's expected_result.txt
  • resize_image — output JPEG byte-identical to expected_result.jpg

🤖 Generated with Claude Code

The documented setup was failing. The native path assumes a Debian host
with LLVM 13, but aWsm's llvm-alt bindings call LLVM C-API functions
(LLVMBuildCall, LLVMBuildLoad) removed in LLVM 15+, so the build fails to
link against newer system LLVM (e.g. LLVM 21 on Ubuntu 24.04). The Docker
route exists for exactly this reason but had bit-rotted in several places.

Dockerfile.x86_64:
- Install `hey` from focal's universe repo instead of downloading the
  prebuilt binary, whose hey-release S3/GCS URLs now return 403.
- Add `git config --system --add safe.directory '*'` so the root-run
  `make install` doesn't abort with "dubious ownership" on the
  host-owned, bind-mounted /sledge.
- Set RUSTUP_HOME/CARGO_HOME to the dev user's install so the root-run
  build can resolve the default Rust toolchain instead of failing with
  "no default is configured".

Makefile:
- Make the wasm_apps symlink rule idempotent (ln -srfn). The symlink is
  committed to the repo, so it already exists on a fresh clone and the
  old `ln -sr` failed with "File exists", breaking `make install`.

README.md:
- Recommend the Docker route and add an explicit caveat to the native
  section documenting the LLVM-13/Debian requirement and why Ubuntu 24.04
  (and other non-LLVM-13 hosts) cannot use it.

Verified end-to-end via `./devenv.sh setup`: aWsm, the runtime, and all
benchmark apps build, and the runtime serves fibonacci, gocr, and
resize_image requests with correct responses.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bushidocodes bushidocodes requested a review from emil916 June 13, 2026 21:30
@bushidocodes

bushidocodes commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

I'm potentially interested in using some of my AI tokens to get this up to date. Here's a PR of some issues I hit trying to clone and run the project.

I've also opened a PR against gocr due to a link not returning a 404. That will take a few layers of PRs to get merged here due to our multi-layer submodule setup.

@emil916 emil916 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than that it looks good.

Comment thread Dockerfile.x86_64 Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be upgraded to "noble", I have been using it locally and it is compatible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emil916 - I pushed a new commit for this and tested the Docker and native install paths on Noble.

The dev toolchain is pinned to LLVM 13 (aWsm builds against an LLVM-13 binding
fork), but apt.llvm.org never published llvm-toolchain-noble-13 and noble dropped
libtinfo5, so a plain focal->noble bump failed to build.

- install_llvm.sh: on noble, pin the focal apt.llvm.org repo for LLVM 13 and
  install the focal-era libtinfo5/libffi7 the LLVM 13 packages need; skip lldb-13
  (needs the absent libpython3.8). Other releases keep the upstream llvm.sh path.
- Dockerfile.x86_64: base on ubuntu:noble; drop libtinfo5 from apt (handled by
  install_llvm.sh); reuse noble's stock ubuntu user at UID/GID 1000 instead of
  creating a colliding dev user.
- install_deb.sh: drop libtinfo5 from apt (handled by install_llvm.sh).
- README: document the validated native build on Ubuntu incl. 24.04 noble, with
  caveats (update-alternatives repoints default clang; focal-pinned packages).

Verified end-to-end on Ubuntu 24.04.4 (noble), x86_64, both in Docker and
natively: aWsm, libsledge, the runtime, and all nine sample *.wasm.so modules
build and sledgert runs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bushidocodes bushidocodes force-pushed the fix/docker-dev-setup branch from 19a49a6 to 8eccb03 Compare June 20, 2026 15:43
@emil916 emil916 merged commit ff59feb into master Jun 22, 2026
0 of 8 checks passed
@emil916 emil916 deleted the fix/docker-dev-setup branch June 22, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants